#-*- coding: utf8 -*-

from tutor.script import *
from tutor.plugin.maple import *

# meta information
meta(author       = 'Fábio Mendes',
     creationdate = datetime(2010, 10, 9),
     status       = 'testing',
     difficulty   = 'easy',
     time         = 10,
     itemtype     = 'test')

# begin question
n = randint(1, 10)
func = x**n
question('Calcule a derivada da equação $$\int\ dx\ ', func, '.$$')
multiplechoice()

# choice: (a)
choice_eq(1, M.int(func, x) + M.C)
explanation('Escolha correta!') 

# choice: (b)
choice_eq(0.75, M.int(func, x))
explanation('Se esqueçeu da constante numa integral indefinida!') 

# choice: (c)
choice_eq(0, M.diff(func, x) + oneof(M.C, 0))
explanation('Calculou a \\emph{derivada}.') 

# choice: (d)
choice_eq(0, (n+1)*x**(n+1) + oneof(M.C, 0))
explanation('Misturou com o cálculo de derivada.') 

# choice: (e)
choice_eq(0, x**(n-1)/(n+1) + oneof(M.C, 0))
explanation('Misturou com o cálculo de derivada.') 

end()